<?php defined('IN_PHPCMS') or exit('No permission resources.'); ?><?php include template('member', 'header'); ?>
<div class="layui-login">
	<div class="layui-title"><h2>用户登录</h2></div>
	<form method="post" action="" class="layui-form layui-form-pane">
		<input type="hidden" name="forward" id="forward" value="<?php echo $forward;?>">
    	<div class="layui-form-item">
			<label class="layui-form-label">用户</label>
			<div class="layui-input-block">
				<input type="text" id="username" name="username" autocomplete="off" placeholder="请输入用户名" class="layui-input" style="width: 170px;">
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label">密码</label>
			<div class="layui-input-block">
				<input type="password" id="password" name="password" autocomplete="off" placeholder="请输入密码" class="layui-input" style="width: 170px;">
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label">验证码</label>
			<div class="layui-input-block">
				<input type="text" id="code" name="code" autocomplete="off" placeholder="验证码" class="layui-input" style="width: 74px;"><?php echo form::checkcode('code_img', '4', '12', 60, 26);?>
			</div>
		</div>
        <div class="layui-form-item">
        	<div class="layui-input-inline" style="width: 160px;">
				<input type="checkbox" name="cookietime" value="2592000" id="cookietime" title="记住用户名" checked="">
			</div>
			<div class="layui-input-inline" style="width: 100px;text-align: right;">
				<a class="layui-getpass" href="index.php?m=member&c=index&a=public_get_password_type&siteid=<?php echo $siteid;?>"><?php echo L('forgetpassword');?></a>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-inline" style="width:100%;">
				<input type="submit" name="dosubmit" id="dosubmit" class="layui-btn" value="<?php echo L('login');?>">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-inline" style="width:100%;text-align: right;">
				<a href="<?php echo APP_PATH;?>index.php?m=member&c=index&a=register&siteid=<?php echo $siteid;?>">没有帐号？<?php echo L('immediately').L('register');?></a>
			</div>
		</div>
	</form>
</div>
<script>
layui.use(['form','jquery','layer'], function(){
  var form = layui.form
  ,layer = layui.layer 
  ,$ = layui.jquery;
  $('#dosubmit').click(function(){
  	var username = $('#username').val();
  	var password = $('#password').val();
  	var code = $('#code').val();
  	if(username.length < 1 || password < 1){
        layer.msg('用户名或密码不能为空！',{icon: 2,time: 500});
        return false;
  	}
  	if(code.length < 1){
        layer.msg('请输入验证码！',{icon: 2,time: 500});
        return false; 		
  	}
  });
});
</script>
<?php include template('member', 'footer'); ?>